{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# The Alien Blaster problem\n",
    "\n",
    "This notebook presents solutions to exercises in Think Bayes.\n",
    "\n",
    "Copyright 2016 Allen B. Downey\n",
    "\n",
    "MIT License: https://opensource.org/licenses/MIT"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "from __future__ import print_function, division\n",
    "\n",
    "% matplotlib inline\n",
    "import warnings\n",
    "warnings.filterwarnings('ignore')\n",
    "\n",
    "import numpy as np\n",
    "\n",
    "from thinkbayes2 import Hist, Pmf, Cdf, Suite, Beta\n",
    "import thinkplot"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Part One\n",
    "\n",
    "In preparation for an alien invasion, the Earth Defense League has been working on new missiles to shoot down space invaders.  Of course, some missile designs are better than others; let's assume that each design has some probability of hitting an alien ship, $x$.\n",
    "\n",
    "Based on previous tests, the distribution of $x$ in the population of designs is well-modeled by a beta distribution with parameters $\\alpha=2$ and $\\beta=3$.  What is the average missile's probability of shooting down an alien?"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.4"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAEACAYAAABcXmojAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xd8leX5+PHPlcneEEYg7D0FAVEhoAi4EKsWrAttoVKt\nVdui7ff7Lf21/Tqq1lpacaL4laIoKkUUEAl7yR4BEmSGvWfIun5/nMOTk5hxkpA8Z1zv1+u8Xud+\nzn2fXOeBnCvP/dxDVBVjjDEGIMLtAIwxxgQOSwrGGGMclhSMMcY4LCkYY4xxWFIwxhjjsKRgjDHG\n4Vd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gp6qZwOVJbr7yTJADLk+QCzXFngtVXaGqp73F\nFXjmg4Qaf/5PADwOfAIcKeC1UOHPubgX+FRV0wBU9RihyZ9zoUB17/PqwHFVzarAGCuMqi4BThZR\npcTfm4GSFAqb/FZUnbQC6oQCf86Fr58CX5VrRO4o9jyISGPgDlV9ndLNjQkW/vyfaAvUEZEFIrJa\nRO6vsOgqlj/nYiLQUUQOABuAJyootkBU4u/N8pq8ZiqAiAzEM9LrOrdjccmrgG+fcignhuJEAVcB\ng4CqwHIRWa6qqUU3C0lDgHWqOkhEWgHzRKSrqp5zO7BgEChJIQ1o5lOO9x7LX6dpMXVCgT/nAhHp\nCrwJDFXVoi4fg5U/56EXME08i77UA4aJSKaqzqygGCuKP+diP3BMVdOBdBFZBHTD0/8eSvw5F6OB\n5wBUdaeI7ALaA99VSISBpcTfm4HSfeRMkBORGDyT3PL/Ys8EHgDwnSBXsWFWiGLPhYg0Az4F7lfV\nnS7EWBGKPQ+q2tL7aIHnvsK4EEwI4N/vxxfAdSISKSJV8NxUTCb0+HMu9gA3Anj7z9sC31dolBVL\nKPwqucTfmwFxpaBlmCAXavw5F8B/A3WAf3n/Ss5U1fyLFAY1P89DniYVHmQF8fP3Y5uIzAE2AtnA\nm6q61cWwy4Wf/y/+DLznM0zzt6p6wqWQy5WITAUSgboishf4AxBDGb43bfKaMcYYR6B0HxljjAkA\nlhSMMcY4LCkYY4xxWFIwxhjjsKRgjDHGYUnBGGOMw5KCMcYYhyUFY4wxjv8Pi4+wbhRJXBwAAAAA\nSUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7fcb2e3efe10>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "prior = Beta(2, 3)\n",
    "thinkplot.Pdf(prior.MakePmf())\n",
    "prior.Mean()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "In its first test, the new Alien Blaster 9000 takes 10 shots and hits 2 targets.  Taking into account this data, what is the posterior distribution of $x$ for this missile?  What is the value in the posterior with the highest probability, also known as the MAP?"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.3076923076923077"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "posterior = Beta(3, 2)\n",
    "posterior.Update((2, 8))\n",
    "posterior.MAP()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Now suppose the new ultra-secret Alien Blaster 10K is being tested.  In a press conference, an EDF general reports that the new design has been tested twice, taking two shots during each test.  The results of the test are confidential, so the general won't say how many targets were, but they report: \"The same number of targets were hit in the two tests, so we have reason to think this new design is consistent.\" \n",
    "\n",
    "Write a class called `AlienBlaster` that inherits from `Suite` and provides a likelihood function that takes this data -- two shots and a tie -- and computes the likelihood of the data for each hypothetical value of $x$.  If you would like a challenge, write a version that works for any number of shots."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "from scipy import stats\n",
    "\n",
    "class AlienBlaster(Suite):\n",
    "    \n",
    "    def Likelihood(self, data, hypo):\n",
    "        \"\"\"Computes the likeliood of data under hypo.\n",
    "        \n",
    "        data: number of shots they took\n",
    "        hypo: probability of a hit, p\n",
    "        \"\"\"\n",
    "        n = data\n",
    "        x = hypo\n",
    "        \n",
    "        # specific version for n=2 shots\n",
    "        likes = [x**4, (1-x)**4, (2*x*(1-x))**2]\n",
    "\n",
    "        # general version for any n shots\n",
    "        likes = [stats.binom.pmf(k, n, x)**2 for k in range(n+1)]\n",
    "        \n",
    "        return np.sum(likes)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "If we start with a uniform prior, we can see what the likelihood function looks like:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "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TvwmA7wLvARe8GZyXeXIu\nHgTeN8bkA5jAHQzqybkwQLTzeTRwyTgHyQYaY8xm4HIzVVr9vekrSaEtA+TyG6kTCDw5F66+heP2\n3kDT4nkQkf7APcaYl/FsbIy/8uRvIhno4RwIulNEHvJadN7lybl4ERgtImeA/cAzXorNF7X6e7Oz\nBq8pLxCRuTju9Jptdyw2+Q3g2qYcyImhJSHAJBy3eXcDtonINmPMcXvDssV8YK8xZp6IJAKfi8g4\nY0yJ3YH5A19JCvnAYJfyQOc29zqDWqgTCDw5F4jIOOAPwAJjTHOXj/7Kk/MwBVguIoKj7XihiFQZ\nY1Z4KUZv8eRc5AEFxphyoFxENgLjcbS/BxJPzsVjwH8BGGNOiEg2MBLY5ZUIfUurvzd9pfnIGiAn\nImE4Brm5/8NegXMsg+sAOe+G6RUtngsRGQy8DzxkjDlhQ4ze0OJ5MMYMcz6G4uhXeCoAEwJ49u/j\nI2C2iASLSBSOTsVMAo8n5yIHuBXA2X6eDJz0apTeJTR9ldzq702fuFIw7RggF2g8ORfA/wZ6AC85\nfyVXGWOm2Rd1x/PwPDTYxetBeomH/z6OiMhq4ABQA/zBGHPYxrA7hYd/F/8BvOlym+YPjTGFNoXc\nqURkGZAK9BSRXOAnQBjt+N7UwWtKKaUsvtJ8pJRSygdoUlBKKWXRpKCUUsqiSUEppZRFk4JSSimL\nJgWllFIWTQpKKaUsmhSUUkpZ/j8XM260q0rlXAAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7fcb2bf20f50>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "pmf = Beta(1, 1).MakePmf()\n",
    "blaster = AlienBlaster(pmf)\n",
    "blaster.Update(2)\n",
    "thinkplot.Pdf(blaster)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "A tie is most likely if they are both terrible shots or both very good.\n",
    "\n",
    "Is this data good or bad; that is, does it increase or decrease your estimate of $x$ for the Alien Blaster 10K?\n",
    "\n",
    "Now let's run it with the specified prior and see what happens when we multiply the convex prior and the concave posterior:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAEACAYAAABcXmojAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xl8VOW9x/HPLyFhJwlbgATCDkJVoIBYvRpxYRHBqrVS\n97ZCRVDbqrhUCFSttNoqoIK96q3eq2jVShBUXIiKiuKCCAYIggESCFvYQvb87h8znExClgkkObP8\n3q9XXq85Z54z82OA+eY8z3nOI6qKMcYYAxDhdgHGGGMCh4WCMcYYh4WCMcYYh4WCMcYYh4WCMcYY\nh4WCMcYYh1+hICKjRWSDiGwSkenVtJkrIhkiskZEBvvsf0ZEckRkbaX2p4vIZyLyjYh8ISJDT+6P\nYowx5mTVGgoiEgHMB0YBA4GJItK/UpsxQC9V7QNMBp7yefo577GV/RWYqaqDgZnA307oT2CMMabe\n+HOmMBzIUNVMVS0GFgETKrWZADwPoKqfAzEiEu/dXgnkVvG6ZUCM93EskFX38o0xxtSnJn60SQC2\n+2zvwBMUNbXJ8u7LqeF1fw+8IyKPAgL8zI9ajDHGNCA3B5pvBm5T1W54AuJZF2sxxhiDf2cKWUA3\nn+1Eju/qyQK61tKmsutV9TYAVX1VRJ6pqpGI2M2ZjDHmBKiq1PUYf84UVgO9RSRJRKKBq4DUSm1S\ngesARGQEcEBVfbuOxPvjK0tEzvUecz6wqboCVNV+VJk5c6brNQTKj30W9lnYZ1Hzz4mq9UxBVUtF\nZCqwHE+IPKOq6SIy2fO0Pq2qy0RkrIhsBvKAG48dLyIvAslAOxHZhueKo+eAScDjIhIJFHi3jTHG\nuMif7iNU9W2gX6V9CyttT63m2F9Vs/8TwOYmGGNMALEZzUEkOTnZ7RIChn0W5eyzKGefxcmTk+l7\nagwiooFeozH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V8\nYICIZAPfArc1Um2BqM7fmw01ec00AhE5D8+VXme7XYtLHgN8+5RDORhq0wQYAowEWgKfichnqrrZ\n3bJcMQr4RlVHikgv4F0ROU1Vj7hdWDAIlFDIArr5bCd691Vu07WWNqHAn88CETkNeBoYrao1nT4G\nK38+h6HAIhERPH3HY0SkWFVTG6nGxuLPZ7ED2KuqBUCBiHwEnI6n/z2U+PNZ3Aj8BUBVfxCRrUB/\n4MtGqTCw1Pl7M1C6j5wJciISjWeSW+X/2KnAdQC+E+Qat8xGUetnISLdgNeAa1X1BxdqbAy1fg6q\n2tP70wPPuMKUEAwE8O//x2LgbBGJFJEWeAYV0wk9/nwWmcAFAN7+877AlkatsnEJ1Z8l1/l7MyDO\nFPQkJsiFGn8+C+B+oC3wpPe35GJVrXyTwqDm5+dQ4ZBGL7KR+Pn/Y4OIvAOsBUqBp1X1exfLbhB+\n/rt4APgfn8s071LVk7gZUOASkReBZKCdiGwDZgLRnMT3pk1eM8YY4wiU7iNjjDEBwELBGGOMw0LB\nGGOMw0LBGGOMw0LBGGOMw0LBGGOMw0LBGGOMw0LBGGOM4/8BGAym8r7IrfUAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7fcb2bf97710>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "pmf = Beta(2, 3).MakePmf()\n",
    "blaster = AlienBlaster(pmf)\n",
    "blaster.Update(2)\n",
    "thinkplot.Pdf(blaster)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The posterior mean and MAP are lower than in the prior."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(0.4, 0.37508201146132331)"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "prior.Mean(), blaster.Mean()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(0.3333333333333333, 0.2)"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "prior.MAP(), blaster.MAP()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "So if we learn that the new design is \"consistent\", it is more likely to be consistently bad (in this case)."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Part Two"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Suppose we\n",
    "have we have a stockpile of 3 Alien Blaster 9000s and 7 Alien\n",
    "Blaster 10Ks.  After extensive testing, we have concluded that\n",
    "the AB9000 hits the target 30% of the time, precisely, and the\n",
    "AB10K hits the target 40% of the time.\n",
    "\n",
    "If I grab a random weapon from the stockpile and shoot at 10 targets,\n",
    "what is the probability of hitting exactly 3?  Again, you can write a\n",
    "number, mathematical expression, or Python code."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.23054197320000014"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "k = 3\n",
    "n = 10\n",
    "x1 = 0.3\n",
    "x2 = 0.4\n",
    "\n",
    "0.3 * stats.binom.pmf(k, n, x1) + 0.7 * stats.binom.pmf(k, n, x2)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The answer is a value drawn from the mixture of the two distributions."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Continuing the previous problem, let's estimate the distribution\n",
    "of `k`, the number of successful shots out of 10.  \n",
    "\n",
    "1. Write a few lines of Python code to simulate choosing a random weapon and firing it.\n",
    "\n",
    "2. Write a loop that simulates the scenario and generates random values of `k` 1000 times.  \n",
    "\n",
    "3. Store the values of `k` you generate and plot their distribution."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "def flip(p):\n",
    "    return np.random.random() < p\n",
    "\n",
    "def simulate_shots(n, p):\n",
    "    return np.random.binomial(n, p)\n",
    "\n",
    "ks = []\n",
    "for i in range(1000):\n",
    "    if flip(0.3):\n",
    "        k = simulate_shots(n, x1)\n",
    "    else:\n",
    "        k = simulate_shots(n, x2)\n",
    "    ks.append(k)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Here's what the distribution looks like."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(1000, 3.71)"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX0AAAEACAYAAABfxaZOAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAADyZJREFUeJzt3X+s3Xddx/Hnq85FtuEUM2poaUWGRZbAxKRMh3pwCmVG\nyl+mxYCMsDSRwiKJGeLIbpP94Y8YA1ZkjZUAGRthuNA/2OwWvH8sZKzgGL9aWxiUtquV4cAMg+m2\nt3+cwzy9u+353t5z7mnP5/lIbu73x+fz/b6/6fa6n/M53+85qSokSW1YNe0CJEkrx9CXpIYY+pLU\nEENfkhpi6EtSQwx9SWpIp9BPsinJgSQHk9y4yP43JXl48HN/kpcP7fv2YPtDSR4cZ/GSpKXJqPv0\nk6wCDgLXAI8C+4AtVXVgqM1VwP6q+kGSTcBcVV012PcI8KtV9fiErkGS1FGXkf5G4FBVHa6qk8Ad\nwObhBlX1QFX9YLD6ALBmaHc6nkeSNGFdwngNcGRo/SinhvpCbwfuHlov4N4k+5Jcv/QSJUnjcsE4\nD5bkNcB1wKuHNl9dVceTXEY//PdX1f3jPK8kqZsuoX8MWDe0vnaw7RSDN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4Stams5fkEuBO4IbBiP+8l+T3gBODVzJh9h44vAB4JfD3VfVK4H/oTxXMhCQ/Q38UvB54AXBJ\nkjdNt6oVMXKAsqIfrVxVv3um/UneSv/l9G+vSEGTdwxYN7S+drBtZgxeOt8JfKyqPj3tesboauAN\nSa4FngM8N8lHq+otU65rXI4CR6rqC4P1O4FZutHgd4BHquq/AJL8M/DrwKwNJk8kWT14Lurngf8c\n1eGcmd5Json+S+k3VNX/TrueMXnmwbbBnQNb6D/INkv+Cfh6Vb1/2oWMU1W9t6rWVdUv0v93++wM\nBT6DKYEjSX5psOkaZusN6+8AVyX5qSShf32z8Eb1wlede4C3Dpb/CBg58DqXvkTl74ALgXv7/0Y8\nUFV/PN2SlmfWH05LcjXwh8BXkjxE/6Xle6vqnulWpo7eBdyW5CeBRxg8VDkLqurBJHcCDwEnB793\nTbeq5UnycaAH/FyS7wA3A38BfDLJ24DDwB+MPI4PZ0lSO86Z6R1J0uQZ+pLUEENfkhpi6EtSQwx9\nSWqIoS9JDTH0Jakhhr4kNeT/AFXkJlHK3e5WAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7fcb2bf718d0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "pmf = Pmf(ks)\n",
    "thinkplot.Hist(pmf)\n",
    "len(ks), np.mean(ks)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The mean should be near 3.7.  We can run this simulation more efficiently using NumPy.  First we generate a sample of `xs`:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Hist({0.29999999999999999: 296, 0.40000000000000002: 704})"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "xs = np.random.choice(a=[x1, x2], p=[0.3, 0.7], size=1000)\n",
    "Hist(xs)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Then for each `x` we generate a `k`:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "ks = np.random.binomial(n, xs)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "And the results look similar."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "3.6280000000000001"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX0AAAEACAYAAABfxaZOAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAADxpJREFUeJzt3X+s3Xddx/Hnq85FtuEUM2poaUWGRZbAxKRMh3pwCmVG\nyl+mxYCMsDSRwiKJGeLIbpP94Y8YA1ZkjZUAGRthuNA/2OwWvH8sZKzgGL9aWxiUtquV4cAMg+m2\nt3+cL/P07rb3e3vPvac9n+cjubnfH5/P9/v+ptvrfs7nfL/npKqQJLVh1aQLkCStHENfkhpi6EtS\nQwx9SWqIoS9JDTH0JakhvUI/yaYkB5IcTHLjPPvflOTh7uf+JC8f2fftbvtDSR4cZ/GSpMXJQvfp\nJ1kFHASuAR4F9gFbqurASJurgP1V9YMkm4CZqrqq2/cI8KtV9fgyXYMkqac+I/2NwKGqOlxVJ4E7\ngM2jDarqgar6Qbf6ALBmZHd6nkeStMz6hPEa4MjI+lFODfW53g7cPbJewL1J9iW5fvElSpLG5YJx\nHizJa4DrgFePbL66qo4nuYxh+O+vqvvHeV5JUj99Qv8YsG5kfW237RTdm7e7gE2j8/dVdbz7/d0k\ndzGcLnpW6CfxQ4AkaZGqKotp32d6Zx9weZL1SS4EtgB7RhskWQd8CnhzVX1zZPtFSS7pli8GXgt8\n9QzFT+XPzTffPPEavD6vz+ubvp+zseBIv6qeSr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qk9Pup4xuhp4Q5JrgecAz03y0ap6\ny4TrGpejwJGq+kK3ficwTTca/A7wSFX9F0CSfwZ+HZi2weSJJKu756J+HvjPhTqcM9M7STYxfCn9\nhqr630nXMybPPNjW3TmwheGDbNPkn4CvV9X7J13IOFXVe6tqXVX9IsN/t89OUeDTTQkcSfJL3aZr\nmK43rL8DXJXkp5KE4fVNwxvVc1917gHe2i3/EbDgwOtc+hKVvwMuBO4d/hvxQFX98WRLWpppfzgt\nydXAHwJfSfIQw5eW762qeyZbmXp6F3Bbkp8EHqF7qHIaVNWDSe4EHgJOdr93TbaqpUnycWAA/FyS\n7wA3A38BfDLJ24DDwB8seBwfzpKkdpwz0zuSpOVn6EtSQwx9SWqIoS9JDTH0Jakhhr4kNcTQl6SG\nGPqS1JD/A1XkJlHB8qz6AAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7fcb2bb16950>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "pmf = Pmf(ks)\n",
    "thinkplot.Hist(pmf)\n",
    "np.mean(ks)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "One more way to do the same thing is to make a meta-Pmf, which contains the two binomial `Pmf` objects:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Pmf({0: 0.028247524900000005, 1: 0.12106082100000018, 2: 0.23347444049999999, 3: 0.26682793200000016, 4: 0.20012094900000013, 5: 0.10291934520000007, 6: 0.03675690899999999, 7: 0.0090016920000000021, 8: 0.0014467004999999982, 9: 0.00013778100000000015, 10: 5.9048999999999949e-06}) 0.3\n",
      "Pmf({0: 0.0060466176, 1: 0.040310784000000037, 2: 0.12093235199999994, 3: 0.21499084800000012, 4: 0.2508226560000002, 5: 0.20065812480000034, 6: 0.11147673600000013, 7: 0.04246732800000004, 8: 0.010616832, 9: 0.0015728640000000028, 10: 0.00010485760000000014}) 0.7\n"
     ]
    }
   ],
   "source": [
    "from thinkbayes2 import MakeBinomialPmf\n",
    "\n",
    "pmf1 = MakeBinomialPmf(n, x1)\n",
    "pmf2 = MakeBinomialPmf(n, x2)\n",
    "\n",
    "metapmf = Pmf({pmf1:0.3, pmf2:0.7})\n",
    "metapmf.Print()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Here's how we can draw samples from the meta-Pmf:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "ks = [metapmf.Random().Random() for _ in range(1000)]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "And here are the results, one more time:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "3.7309999999999999"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAEACAYAAABI5zaHAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAADixJREFUeJzt3XGonfV9x/H3J8tkU7uOgghNTNbVLq6CdQ5SN7vtiENT\nB8v+TBwtCJX80WtlwrAUizeQf8YYoyXrapgrOCSW2Yn+YSWW7v4hRY2duromJK2aJjEL2lmHHYUY\nv/vjnJqT60nuc5OTPNfffb/gkvM8z++5z+8+xvd98pxz7k1VIUlqy4q+JyBJmj7jLkkNMu6S1CDj\nLkkNMu6S1CDjLkkN6hT3JBuS7E2yL8ldE7bfkuSF0ceTSa4a2/bKaP1zSZ6Z5uQlSZNlode5J1kB\n7ANuAF4FdgObqmrv2JhrgT1V9WaSDcBsVV072vYS8PtV9cY5+hokSfN0uXJfD+yvqgNVdQx4ENg4\nPqCqnqqqN0eLTwGrxjan43EkSVPSJbqrgINjy4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Z+OfpT4KWq+p+qOg78G/CHPc9pIuM+9iat0bPe\nmxi+KWs5+2fgh1X1lb4n0peq+lJVramq32b4d+K7VfXZvufVh6o6ChxM8jujVTewfJ9k/glwbZJf\nSxKG52JJPrm87H9Zh2+0OlmS64C/BH6Q5DmG95u/VFWP9zsz9ewLwANJfhV4idEbFZebqnomyUPA\nc8Cx0Z87+p3VZL6JSZIa5G0ZSWqQcZekBhl3SWqQcZekBhl3SWqQcZekBhl3SWqQcZekBv0/7qjQ\n49GPrfwAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7fcb2b9fd810>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "pmf = Pmf(ks)\n",
    "thinkplot.Hist(pmf)\n",
    "np.mean(ks)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "This result, which we have estimated three ways, is a predictive distribution, based on our uncertainty about `x`.\n",
    "\n",
    "We can compute the mixture analtically using `thinkbayes2.MakeMixture`:\n",
    "\n",
    "\n",
    "    def MakeMixture(metapmf, label='mix'):\n",
    "        \"\"\"Make a mixture distribution.\n",
    "\n",
    "        Args:\n",
    "          metapmf: Pmf that maps from Pmfs to probs.\n",
    "          label: string label for the new Pmf.\n",
    "\n",
    "        Returns: Pmf object.\n",
    "        \"\"\"\n",
    "        mix = Pmf(label=label)\n",
    "        for pmf, p1 in metapmf.Items():\n",
    "            for k, p2 in pmf.Items():\n",
    "                mix[k] += p1 * p2\n",
    "        return mix\n",
    "        \n",
    "The outer loop iterates through the Pmfs; the inner loop iterates through the items.\n",
    "\n",
    "So `p1` is the probability of choosing a particular Pmf; `p2` is the probability of choosing a value from the Pmf.\n",
    "\n",
    "In the example, each Pmf is associated with a value of `x` (probability of hitting a target).  The inner loop enumerates the values of `k` (number of targets hit after 10 shots)."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "3.7000000000000028"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX0AAAEACAYAAABfxaZOAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAD3BJREFUeJzt3X+s3Xddx/Hnq9ZFtuEUM2po14oMiyyBiUmZDuXgFMqM\nlL9MSwIyw9JEiosYM8SR3Sb7wx8xBlKRNVYCZmwEcNI/YHYET8xCBgXH+NXawqC0Xa0Mx8wwmG57\n+8c5jNO723u/p/fHuaef5yO5ud/v5/v5fM/7NtvrfO7n+/2em6pCktSGNZMuQJK0cgx9SWqIoS9J\nDTH0Jakhhr4kNcTQl6SGdAr9JFuTHE5yJMnNcxx/Q5IHh1/3JXnJyLFvDdsfSPK5pSxekjSeLHSf\nfpI1wBHgOuBh4CCwvaoOj/S5BjhUVY8l2QrMVNU1w2MPAb9cVY8u088gSeqoy0x/C3C0qo5V1Rng\nLmDbaIequr+qHhvu3g+sHzmcjq8jSVpmXcJ4PXB8ZP8EZ4f6bG8BPjmyX8C9SQ4muXH8EiVJS2Xt\nUp4syauAG4BXjDRfW1WnklzOIPwPVdV9S/m6kqRuuoT+SWDjyP6GYdtZhhdv9wJbR9fvq+rU8Pt3\nktzNYLnoGaGfxA8BkqQxVVXG6d9leecgcGWSTUkuArYD+0c7JNkIfAx4Y1V9Y6T94iSXDrcvAV4N\nfGWe4qfy69Zbb514DdY/+Tqsfzq/prn+87HgTL+qnkyyCzjA4E1iX1UdSrJzcLj2Au8CngO8N0mA\nM1W1BVgH3D2cxa8F7qiqA+dVqSRp0Tqt6VfVPcDmWW23j2zfCDzjIm1VfRO4epE1SpKWiLdSLoFe\nrzfpEhbF+ifL+idr2usf14IPZ62UJLVaapGkaZCEWoYLuZKkC4ShL0kNMfQlqSGGviQ1xNCXpIYY\n+pLUkCX9wDVpqey67c5lOe+eW3Ysy3mlaeFMX5Ia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+eosBnuKRwPMkvDJuuY7ouSH8buCbJTyQJ\ng/qn4UL07N8K9wNvHm7/HrDaJz5n1X8+ublq7tNPchS4CPjusOn+qvqDCZbUyfAf/d386OGzP59w\nSZ0luRb4N+DLDH6tLeCdVXXPRAsbU5JXAn9cVa+bdC3jSPJSBhehfxx4CLihqh6bbFXdJbmVwRvu\nGeAB4C3DGxpWpSQfAnrAzwCngVuBfwY+AlwBHAN+t6q+N6ka53OO+t/JmLm5akJfkrT8Vs3yjiRp\n+Rn6ktQQQ1+SGmLoS1JDDH1JaoihL0kNMfQlqSGGviQ15P8BpelhM49t60MAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7fcb2b95d610>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "from thinkbayes2 import MakeMixture\n",
    "\n",
    "mix = MakeMixture(metapmf)\n",
    "thinkplot.Hist(mix)\n",
    "mix.Mean()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**Exercise**: Assuming again that the distribution of `x` in the population of designs is well-modeled by a beta distribution with parameters α=2 and β=3, what the distribution if `k` if I choose a random Alien Blaster and fire 10 shots?"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.11"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
